#ifndef MAINWINDOW_H
#define MAINWINDOW_H

#include <QDialog>
#include <QSystemTrayIcon>
#include <QList>
#include <QSettings>
#include "diskeditor.h"

namespace Ui {
class MainWindow;
}

class MainWindow : public QDialog
{
    Q_OBJECT

public:
    explicit MainWindow(QWidget *parent = 0);
    ~MainWindow();

public slots:
    void close() ;


private slots:
     void on_tray_activated(QSystemTrayIcon::ActivationReason reason);
     void on_newDriveBut_clicked();
     void on_modifyDriveBut_clicked();
     void on_deleteDriveBut_clicked();
     void on_DisksView_itemSelectionChanged();

     void on_mountDriveBut_clicked();
     void on_unMountDriveBut_clicked();
     void on_tray_messageClicked ();
     void on_trayMenu_triggered ( QAction * action );

private:

    void lineApparence(int index,bool ismounted);
    void mount(int index);
    void unmount(int index);
    void enableMountButtons(int index);
    void readConfig();
    void writeConfig();
    void createTableLine(const QString & name, const QString &point);

    Ui::MainWindow *ui;
    QSystemTrayIcon * tray;
    QMenu *trayMenu;
    QList<QAction *> actionTrayList;
    QFont bold,nobold;
    QString  diskFileName;
    QSettings settings;

    DisKEditor diskeditor;

    QAction * quitAction;
    QAction * saveConfigAction;

    void initDriveList();

    void createMenuTray();
};



#endif // MAINWINDOW_H
